﻿
<script type="text/javascript">
$(document).ready(function(){
						   
$("#siteSearchInput").keyup(function() 
{
var searchbox = $(this).val();
var dataString = 'searchword='+ searchbox;

if(searchbox=='')
{
}
else
{

$.ajax({
type: "POST",
url: "search.php",
data: dataString,
cache: false,
success: function(html)
{
	$("#display").html(html).show();
}
});
}return false;    


});
});
jQuery(function($){
   $("#siteSearchInput").Watermark("Oyun Ara...");
   $(document).click(function(e){
	var target = $(e.target);
	if(target.parents("#display").length==0){
		$("#display").css("display","none");
	}
//		$("#display").css("display","none");
//		$("#display").mouseout(function(){
//			$("#display").css("display","none");
//		});
      });
   
	$("#logout").click(function(){
		$.ajax({
		type: "POST",
		url: "logout.php",
		data: dataString,
		cache: false,
		success: function(html)
		{
			alert("logout ok");
		}
		});
	});

	

   });

</script>

<style type="text/css">

#display
{
	position:absolute;
	width:187px;
	display:none;
	float:right;
	margin-top:30px;
	right:57px;
	border-color:#333333 #333333 #293E6A;
	border-style:solid;
	border-width:1px 1px 1px;
	overflow:hidden;
}
#display_box
{	
	width:187px;
	background:none repeat scroll 0 0 #FFFFFF;
	overflow:hidden;
	padding:2px 0;
	border-top:solid 1px #dedede; 
	font-size:12px; 
	height:50px;
	color:#3B5998;
}

#display_box:hover
{
	background:#D8DFEA;
	color:#FFFFFF;
}
#shade
{
background-color:#00CCFF;

}
</style>

    
    
    <div id="topBar">
		<div id="topLimiter">
			<h1><a href="index.php" title="Ana sayfa" id="logo">Oyuncu</a></h1>
    <ul id="navigation">
        <li><div><a href="index.php" class="level0">Ana Sayfa</a></div></li>
        <li><div><a href="latestGames.php" class="level0">En Yeniler</a></div></li>
        <li><div><a href="mostPlayedGames.php" class="level0">En Çok Oynananlar</a></div></li>
        <li><div><a href="myProfile.php" class="level0">Profilim</a></div></li>
        </ul>
        	<div id="searchForm">
	        	
            		<div id="searchBox"><input type="text" style="font-style:italic" id="siteSearchInput" name="s" class="defaultText"></div>
                    <div id="display" align="right"></div>
                	<div>
                    	<input type="submit" value="Submit" id="submitButton">
                        
                    </div>
            	
                
        	</div>
            <?php if(!isset($_SESSION["user_name"])){
            	echo '<a href="login.php" title="Kullanıcı Girişi"><img src="images/businessman_woman.png"  style="float:right;top:19px;height:30px;position:relative"/></a>';
				}else{
				echo  '<a href="logout.php" id="logout" title="Çıkış"><img src="images/businessman_woman.png"  style="float:right;top:19px;height:30px;position:relative"/></a>';
				}
				
            ?>
    	</div>
	</div>	
